There are various high level languages which are in wide use for computer programming, e.g., C, COBOL, FORTRAN, PL/I, PASCAL, etc. Computer programs may be written in more than one of these languages. Execution of programs written in these languages normally requires that language specific run-time support code be present and initialized to enable the code produced by the respective compilers to function correctly. It is desirable to allow for the language specific run-time support code to be written in multiple languages, but this presents special problems. Termination ordering also presents similar problems.
During initialization and termination of a multi-language application program, language specific initialization and termination routines are called for each language in the application. When the language specific routine for a particular language requires support provided by a second language then the second language's support must be initialized before the first language's support is initialized and terminated only after the first language's support has been terminated.
The idea of ordering based on dependencies is known. Knuth, for example, describes the problem in The Art of Computer Programming, Vol. 1, Addison-Wesley, 1975, pages 258-265. Knuth describes the problem of topological sorting of a set on which a partial ordering is defined. The goal is to find a linear sequence of the members of the set such that any item in the sequence will precede another in the sequence if the one is defined to precede the other in the partial ordering. Knuth describes an algorithm for topological sorting.
The problem of initialization ordering is related to topological sorting. The dependency that one language has upon the initialization of another defines a partial ordering between the languages. The problem is to find an order to initialize languages in a multi-language application so that for any language in the application, all languages that it depends upon are initialized by the time it must be initialized. Termination can then be performed in the reverse order.
It is also posssible for programs to have dependencies on support programs which are unrelated to language support as such. Dependency on a debugging program would be an example of this.
It is conventional in the computer science field to use control blocks (sometimes called headers) containing non-executable code to convey information needed to execute a program. Control blocks which give initial information about a program are sometimes called program headers.
The term "application program" (or simply "application") will be used to include both end-user developed computer programs and computer programs which are sometimes called system programs, such as compilers. For convenience, the term "program" will be used to include routines or modules which in other contexts might not be considered to be programs. Thus, language specific run-time support routines will be called programs even though they may be inherently incapable of independent execution.